package com.taxi.controller;

import com.taxi.dto.OrderInfo;
import com.taxi.result.Result;
import com.taxi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("/list")
    public Result getOrderList(@RequestParam int page, @RequestParam int limit, @RequestParam(required = false) String address, @RequestParam(required = false) String phone){
        return orderService.getOrderList(page, limit, address, phone);
    }

    @PostMapping("/update")
    public Result updateOrder(@RequestBody OrderInfo orderInfo){
        return orderService.updateOrder(orderInfo);
    }

}
